const mongoose = require('mongoose')

const db = mongoose.connection
const connect = async function () {
    await mongoose.connect('mongodb://localhost:27017/user') // 暂时写死数据库uri
    db.on('error', console.error.bind(console, 'mongodb connect error'))
    db.once('open', console.log.bind(console, 'mongodb connect success'))
}
module.exports = connect
    
